/**
 * Lockbox
 * a Password and Secret Information Manager
 * View to edit and select tags
 *
 * Created by Nathan Black
 * 
 * Licensed under GPL v2
 */

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <UIKit/UIApplication.h>
#import <UIKit/UITable.h>
#import <UIKit/UIPreferencesTableCell.h>
#import <UIKit/UIPreferencesTextTableCell.h>
#import "LockboxStorage.h"
#import "UIPreferencesTableEx.h"

#define LBTV_NAVBAR_HEIGHT (45.0f)

@interface LockboxTagView : UIView
{
    UIPreferencesTableEx* _prefsTable;
    UINavigationBar* _navBar;
    UIPreferencesTableCell* _tagsGroupCell;
    NSMutableArray* _tagCells;
    UIPreferencesTextTableCell* _addTagCell;

    BOOL _recentlyAdded;
    BOOL _dirty;
    int _editRowBase;
    int _tagGroup;
    
    LockboxStorage* _storage;
    id _transDelegate;
    id _tagDelegate;
}

- (id)initWithFrame:(struct CGRect)frame app:(id)app tagDelegate:(id)tagDelegate;
- (void)dealloc;
- (void)setTags:(NSMutableArray*)tags;
- (int)getTagCount;
- (void)setNavBarButtons:(BOOL)editing;
- (void)exitView;

// protected:  yeah if objc was up to snuff, this is where the protected declaration would go.
- (int) preferencesTable: (UIPreferencesTable*)table numberOfRowsInGroup: (int)group;
- (UIPreferencesTableCell*) preferencesTable: (UIPreferencesTable*)table cellForRow: (int)row inGroup: (int)group;
- (UIPreferencesTableCell*) preferencesTable: (UIPreferencesTable*)table cellForGroup: (int)group;
- (NSMutableArray*)saveTags;
- (float) preferencesTable: (UIPreferencesTable*)table heightForRow: (int)row inGroup: (int)group withProposedHeight: (float)proposed;

@end
